package org.mspring.mlog.api.duoshuo.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

/**
 * 将评论同步到多说的请求对象
 * 
 * @author Gao Youbo
 * @since 2013年9月23日
 */
public class Sync2DS implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = -1449098280241289139L;
    private String short_name;
    private String secret;
    private List<DSComment> posts;

    public String getShort_name() {
        return short_name;
    }

    public void setShort_name(String short_name) {
        this.short_name = short_name;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public List<DSComment> getPosts() {
        return posts;
    }

    public void setPosts(List<DSComment> posts) {
        this.posts = posts;
    }

    public List<NameValuePair> getNameValuePairs() {
        List<NameValuePair> nvps = new ArrayList<NameValuePair>();
        nvps.add(new BasicNameValuePair("short_name", this.short_name));
        nvps.add(new BasicNameValuePair("secret", this.secret));
        if (this.posts != null && posts.size() > 0) {
            for (DSComment post : posts) {
                nvps.addAll(post.getArrayNameValuePairs());
            }
        }
        return nvps;
    }
}
